﻿@using BlueLight.Server.Models
@using RuoVea.ExEnum
@using RuoVea.OmiApi.Dict.Entitys
@using RuoVea.OmiApi.Dict.Service
@inject SysDictTypeService sysDictTypService;
@{
    Layout = "_Layout";
    ViewData["active"] = "home";

    // 首页大图
    SysDictValue? banner = (await sysDictTypService.GetTypeAndDataByCodeAsync("BANNER"))?.Children?.FirstOrDefault();
    // 我们的优势
    SysDictType cardgroup = await sysDictTypService.GetTypeAndDataByCodeAsync("CARDGROUP");
    // 产品介绍
    SysDictType product = await sysDictTypService.GetTypeAndDataByCodeAsync("PRODUCT");
    // 我们的团队
    SysDictType carddeck = await sysDictTypService.GetTypeAndDataByCodeAsync("CARDDECK");
    // 横道图的用户是这样说的
    SysDictType companyuser = await sysDictTypService.GetTypeAndDataByCodeAsync("COMPANYUSER");
    int j = 0;
}
<div class="bl-bgclor container-fluid">
    <div class="bl-banner container">
        <p>@Html.Raw(banner?.Label)</p>
        <div class="banner-img" data-aos="fade-up"><img src="@banner?.ExtData" /></div>
    </div>
</div>

<div class="container bl-card">
    <h3 class="bl-card-title">@Html.Raw(cardgroup?.Name)</h3>
    <div class="card-group bl-card-body">
        @foreach (var x in cardgroup?.Children ?? new List<SysDictValue>())
        {
            <div class="card card-body-item">
                <div class="item-icon">
                    <i class="fa @x.Value fa-4x align-middle" aria-hidden="true"></i>
                </div>
                <div class="card-body item-body item-body">
                    <h3 class="card-title">@Html.Raw(x.Label)</h3>
                    <p class="card-text"><small class="text-muted">@Html.Raw(x.ExtData)</small></p>
                </div>
            </div>
        }
    </div>
</div>
<div class="container bl-card">
    <h3 class="bl-card-title">@Html.Raw(product?.Name)</h3>
    @foreach (var x in product?.Children ?? new List<SysDictValue>())
    {
        <div class="row product-box-body @(j % 2 == 0 ? " bl-active" : "")">
            @if (j % 2 == 0)
            {
                <div class="col-md-6 col-sm-12 product-box-left product-box-image" data-aos="zoom-in">
                    <img class="card-img-left" src="@x.ExtData" alt="Card image cap" />
                </div>
                <div class="col-md-6 col-sm-12 product-box-right product-box-content" data-aos="fade-left">
                    <h3 class="card-title">@Html.Raw(x.Label)</h3>
                    <p>@Html.Raw(x.Value)</p>
                    <p>@Html.Raw(x.Remark)</p>
                </div>
            }
            else
            {
                <div class="col-md-6 col-sm-12 product-box-right product-box-content" data-aos="fade-left">
                    <h3 class="card-title">@Html.Raw(x.Label)</h3>
                    <p>@Html.Raw(x.Value)</p>
                    <p>@Html.Raw(x.Remark)</p>
                </div>
                <div class="col-md-6 col-sm-12 product-box-left product-box-image" data-aos="zoom-in">
                    <img class="card-img-left" src="@x.ExtData" alt="Card image cap" />
                </div>
            }
        </div>
        j++;
    }
</div>
<div class="container">
    <h3 class="bl-card-title">@Html.Raw(carddeck?.Name)</h3>
    <div class="card-deck text-center" data-aos="fade-left">
        @foreach (var x in carddeck?.Children ?? new List<SysDictValue>())
        {
            <div class="card">
                <div class="card-img-top"><img src="@x.ExtData" alt=""></div>
                <div class="card-body">
                    <h3 class="card-title">@Html.Raw(x.Label)</h3>
                    <p class="card-text"><small class="text-muted">@Html.Raw(x.Value)</small></p>
                </div>
            </div>
        }
    </div>
</div>
<div class="container">
    <h3 class="bl-card-title">@Html.Raw(companyuser?.Name)</h3>
    <div class="card-deck" data-aos="fade-right">
        @foreach (var x in companyuser?.Children ?? new List<SysDictValue>())
        {
            <div class="card">
                <div class="card-body">@Html.Raw(x.ExtData)</div>
                <div class="card-body">
                    <h3 class="card-title">@Html.Raw(x.Label)</h3>
                    <p class="card-text"><small class="text-muted">@Html.Raw(x.Value)</small></p>
                </div>
            </div>
        }
    </div>
</div>
